cmake_minimum_required(VERSION 3.14)

project(simple-torrent-metadata-query LANGUAGES CXX VERSION 1.0.0)

include(cmake/SparkWithGit.cmake)
spark_initialize_modules()

# 资源文件路径
set(QRC_SOURCES "")

spark_add_executable_path(${PROJECT_NAME} 
    src
    src/widgets
    src/widgets/animationwidgets/animationtext
    src/widgets/animationwidgets/amimagepreview
    src/widgets/picimage
    ${QRC_SOURCES}
)
target_include_directories(${PROJECT_NAME} 
    PRIVATE src/widgets/animationwidgets/amimagepreview)
target_link_qt5(${PROJECT_NAME})

spark_framework_include_with_git(${PROJECT_NAME} 
    https://gitee.com/spark-framework-libs/spark-framework-features
    FEATURES version screenutil)

spark_framework_include_with_git(${PROJECT_NAME} 
    https://gitee.com/spark-framework-libs/qutils)

spark_framework_include_with_git(${PROJECT_NAME} 
    https://gitee.com/spark-framework-libs/network-access-libs
    FEATURES httpmanager)



spark_include(cmake/SparkDesktopMacros.cmake)
# 内容默认应用名称: Name= 应与项目名称相同
spark_desktop_macros(
    # 应用名称: Name=
    "Simple Torrent Metadata Query"
    # 应用名称: Name[zh_CN]=
    "种子链接元数据查询"
    # 应用说明: Comment=
    ""
    # 应用类型: Type=
    "Application"
    # 执行程序: Exec=
    "${PROJECT_NAME}"
    # 图标路径: Icon=
    "${PROJECT_NAME}"
    # 应用分类: Categories=
    "Utilities;"
    # MIME类型: MimeType=
    ""
)
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)

# TODO 安装位置：INSTALL(将自动实现 install 文件，如 /usr/share/applications)

install(FILES ${SPARK_DESKTOP_FILE}
    DESTINATION /usr/share/applications
)
install(FILES assets/icon.png
    DESTINATION /usr/share/icons/hicolor/512x512/apps
    RENAME ${PROJECT_NAME}.png
)
# 注释行(使用方式)
spark_include(SparkDebPackageConfig.cmake)
add_package_descript(cmake/spark-deb-package.descript)